<template>

    <a-input style="margin-left:5px" class="yuan-form-input" v-model="data" placeholder="请输入" :suffix="count+'/'+maxNum"
        @input="inputChange" :maxLength="maxNum"></a-input>
</template>

<script lang="ts">
import { Vue, Component, Prop, Watch } from "vue-property-decorator";
@Component({
    name: "dom",
    components: {},
})
export default class index extends Vue {
    @Prop({ default: "" }) value!: string;
    @Prop({ default: "" }) maxNum!: number;
    @Watch("value")
    valueChange() {
        this.data = this.value + "";
        this.count = this.data.length;
    }
    mounted() {
        this.data = this.value + "";
        this.count = this.data.length;
    }
    count = 0;
    data = "";
    inputChange() {
        this.count = this.data.length;
        this.$emit("input", this.data);
    }
}
</script>
